package com.liu.project.utils;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: project
 * @description: 自定义Message
 * @author: 86187
 * @create: 2022-01-09 15:47
 **/


@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.liu.project.utils.Message",description = "返回信息格式")
public class Message<T> {
    @ApiModelProperty(name = "code")
    private int code;
    @ApiModelProperty(name = "reason",value = "错误或成功信息")
    private String reason;
    @ApiModelProperty(name = "data",value = "返回的数据内容")
    private T data;

    public Message(int code, String reason) {
        this.code = code;
        this.reason = reason;
    }

}